#include<iostream>
#include<vector>
#include<queue>
using namespace std;
int main()
{
    int n = 0, k = 0;
    priority_queue<int> heap;
    cin >> n >> k;
    vector<int> a(n);
    long long sum = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        sum += a[i];
        if (a[i] % 2 == 0) heap.push(a[i]);
    }

    while (k-- && heap.size())
    {
        int t = heap.top() / 2;
        heap.pop();
        sum -= t;
        if (t % 2 == 0) heap.push(t);
    }
    cout << sum << endl;

    return 0;
}